myApp.controller('signupController',function($scope,$state,toaster,$serGroom,$location,$stateParams,$serAccessSignin) {
    var ctrl = this;
    ctrl.user = {
        code:$stateParams.code ||''
    };
    ctrl.login = function () {
        $serAccessSignin.register({
            user_name: ctrl.user.phone,
            password: ctrl.user.password,
            nick_name: ctrl.user.nick_name,
            code: ctrl.user.code,
            qq: ctrl.user.qq,
            wx: ctrl.user.wx,
            email: ctrl.user.email
        }).then(function (res) {
            if (res.code == 1) {
                toaster.info('提示', res.message);
                $state.go('access.signin');
            } else {
                toaster.info('提示', res.message);
            }

        });
    };

    var vm = {
        init:function(){
            $serGroom.logIt({
                code:$stateParams.code
            }).then(function(res){

            })
        }
    };

    vm.init();
});
